﻿
namespace Thor.WebRole.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Configuration;
    using System.IO;
    using System.Linq;
    using System.Web.DomainServices;
    using System.Web.Ria;
    using System.Web.Ria.Services;
    using Thor.Domain;
    using Thor.Domain.Configuration;

    [EnableClientAccess()]
    public class AdministratorAccountManagerDomainService : DomainService
    {
        public IQueryable<AdministratorAccount> GetAdministratorAccounts()
        {
            AdministratorAccountManager manager = AdministratorAccountHelper.GetManager();

            List<AdministratorAccount> administratorAccounts = manager.Administrators;

            return administratorAccounts.AsQueryable();
        }

        public void InsertAdministratorAccount(AdministratorAccount administratorAccount)
        {
            AdministratorAccountHelper.GetManager().Insert(administratorAccount);
        }

        public void UpdateAdministratorAccount(AdministratorAccount administratorAccount)
        {
            AdministratorAccountHelper.GetManager().Update(administratorAccount);
        }

        public void DeleteAdministratorAccount(AdministratorAccount administratorAccount)
        {
            AdministratorAccountHelper.GetManager().Delete(administratorAccount);
        }
    }
}